package com.esms.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.esms.dao.DepartmentMapper;
import com.esms.dao.EmployeeMapper;
import com.esms.dao.SatisfactionMapper;
import com.esms.po.Gassessment;
import com.esms.po.Satisfaction;
import com.esms.service.IEmployeeSatisfactionServer;

@Service
public class EmployeeSatisfactionServerImpl implements IEmployeeSatisfactionServer {
	@Autowired
    private SatisfactionMapper satisfactionMapper = null;
	@Autowired
    private EmployeeMapper employeeMapper = null;
	@Autowired
    private DepartmentMapper departmentMapper = null;
	
    @Override
	public List<Satisfaction> getEmployeeSatisfactionList(String eId,int FdId, String fEid) {
    	if(FdId == 0) {
    		return satisfactionMapper.selectBypIdAnddId(eId, fEid);
    	}else {
    		return satisfactionMapper.selectBypIdAnddIdAndfEid(eId,FdId,fEid);
    	}
	}
    
    @Override
    public int updateSatisfactionList(Satisfaction satisfaction) {
         return  satisfactionMapper.updateBysId(satisfaction); 
    
    }
    
    @Override
    public int deleteSatisfaction(String aAuserid , String aDuserid) {
         return  satisfactionMapper.deleteSatisfaction(aAuserid, aDuserid);
    
    }
    
    @Override
    public int insertSatisfaction(Gassessment gassessment) {
         return  satisfactionMapper.insertSatisfaction(gassessment); 
    
    }
    public String getDBaccount() {
    	return satisfactionMapper.selectByStat(2,1);
    }
}
